package org.jason.backstage.controller;

import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jason.backstage.service.UserService;
import org.jason.model.common.dtos.ResponseResult;
import org.jason.model.user.pojos.CuUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value="用户管理",tags={"用户管理接口"})
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    //获取用户表
    @ApiOperation("获取用户表")
    @SaCheckRole("admin")
    @GetMapping("/getUserTable")
    public ResponseResult<List<CuUser>> getUserTable(){
        return userService.getUserTable();
    }
}
